<%-- 
    Document   : session
    Created on : Jul 22, 2013, 12:43:34 PM
    Author     : Admin
--%>

<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>.: Session Manager :.</title>
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.blockUI.js"></script>
        <script type="text/javascript">
            $(function() {
                $("#datepicker2").datepicker({
                    showOn: "button",
                    buttonImage: "${pageContext.request.contextPath}/images/icon/calendar.gif",
                    buttonImageOnly: true,
                    changeMonth: true,
                    dateFormat: 'dd/mm/yy',
                    changeYear: true                    
                });
            });
            
            function unblockUI() {
                $.unblockUI();
            }
            
            function blockUI () {
                $.blockUI();
            }
            
            function confirmation(userID){
                var confirmResult = confirm('Are you sure want to kill session '+userID+'?');
                return confirmResult;
            }
        </script>
    </head>
    <body>
        <s:messages/>
        <s:errors/>
        <s:form beanclass="exatrez.stripes.SessionActionBean" name="formList">
            <s:hidden name="counterId" />
            <s:hidden name="currentYear" />
            <div>
                <fieldset>
                    <div id="page-title">
                        <span class="title">Session Manager</span>
                    </div>
                    <div>
                        <s:submit name="viewList" value="Reload" class="btn" /><br />
                        <span class="sub-title">List All Active Session</span>                        
                        <display:table class="tablecloth" name="${actionBean.sessionActive}" requestURI="/sessionManager?viewList" id="line" >
                            <display:column title="No."><center>${line_rowNum}.</center></display:column>
                            <display:column title="User ID" sortable="true" property="userId" />                            
                            <display:column title="Session ID" sortable="true" property="sessionId"/>
                            <display:column title="Date Created" sortable="true" ><fmt:formatDate value="${line.dateCreated}" pattern="dd/MM/yyyy hh:mm:ss a"/></display:column>
                            <%-- <display:column title="IP Address" sortable="true" property="IPAddr"/> --%>
                            <display:column title="IP Address" sortable="true" property="computerName"/>
                            <display:column title="Action" >
                                <center>
                                    <a href="sessionManager?killSession&sessionKill=${line.sessionId}" onclick="javascript:return confirmation('${line.userId}');">
                                        <img src="${pageContext.request.contextPath}/images/icon/not_ok.gif" alt="Kill Session" width="20" height="20"/>
                                    </a>
                                </center>
                            </display:column>
                        </display:table>
                    </div>
                </fieldset>
            </div>
        </s:form>
    </body>
</html>
